<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    let per = {
      // 属性名：属性值  必须用,分隔
      gender: '男',
      age: 18,
      aihao: '唱歌',

      // 对象的方式是属性名：function
      speak: function () {
        document.write(`hi~`)
      },
      eat: function (f) {
        document.write(`我最喜欢吃的东西是${f}`)
      }
    }
    document.write(`性别是${per.gender}<br>`);
    document.write(`年龄是${per.age}<br>`);
    document.write(`爱好是${per.aihao}<br>`);


    // 对象的方法打印出来是对象名.属性名() 
    per.speak()
    per.eat(`香蕉`)
  </script>
</body>

</html>